#include "user.h"

User::User()
{
//    this->createPost(); //创造一个端口
}

User::User(QString userName,QString passWord, QString score, QString nickName)
{
    this->userName = userName;
    this->passWord = passWord;
    this->score = score;
    this->createPost(); //创造一个端口
    this->nickName = nickName;
}

User::User(QString userName, QString passWord, QString score, QString post, QString nickName){
    this->userName = userName;
    this->passWord = passWord;
    this->score = score;
    this->post = post;
    this->nickName = nickName;
}

//创造一个端口
void User::createPost()
{
    srand(time(NULL));
    this->post = QString::number(rand() % 55536 + 10000); //随机产生10000到65535的端口
}
